public class J01array2 {
    public static void main(String[] args) {
        String[] nameArr = {"鲁迅","李清照","曹雪芹"};
        String[] name2Arr = {"鲁迅2","李清照2","曹雪芹2"};

        //定义二维数组
        String[][] scoreArr=null;
        String scoreArr2[][];//不推荐
        System.out.println(scoreArr);//null

        System.out.println("=======");
        /*
        特殊的一维数组
         */
        int[][] ageArr = {
                {4,6,2,7},
                {5,2,7,9},
                {66,77,99}
        };
        System.out.println("ageArr = " + ageArr);//地址
        System.out.println("ageArr[0] = " + ageArr[0]);//地址
        System.out.println(ageArr[0][0]);//4
        System.out.println(ageArr[2][1]);//77
        ageArr[2][1]=999;
        System.out.println(ageArr[2][1]);//999
        //静态初始化完整写法
        int[][] arr3 = new int[][]{
                {1,1,1},
                {2,2,2}
        };

        //动态初始化
        int[][] arr4 = new int[3][4];

        System.out.println(arr4[0][0]);
        //二维下标总数，可以不同
        int[][] arr5 = new int[][]{
                {1,1,1},
                {2},
                {33,44,55,6,77,99}
        };
        /*

             **
              *
              ****
         */
        /*
        Exception in thread "main" java.lang.

        Array Index Out Of Bounds Exception

        : 1
	at J01array2.mai
         */
        System.out.println(arr5[1][1]);
    }

}
